package edu.sctu.zhoumengxue.day201506.day20150615.bufferReader;

import java.io.*;

/**
 * Created by user12 on 2015/6/15.
 */
public class ReaderPractice {

    public void iaTest() {

        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        try {
            System.out.println(reader.readLine());
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

    public void readFile(){

        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        System.out.println("请输入一段文字，可包含空白：");
        try {
            String text = reader.readLine();
            System.out.println("您输入的文字："+text);
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

    public void isReader(){
        try {
            FileWriter writer = new FileWriter("D://zhou.txt");
            BufferedWriter buffer = new BufferedWriter(writer);
            buffer.write("Hello World!");
            buffer.newLine();
            buffer.write("夏磊是猪");
            buffer.newLine();
            buffer.write("猪是夏磊");
            buffer.flush();
            buffer.close();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }




}
